﻿<%@ Page Language="C#" MasterPageFile="~/JOINT/MstPage_JOINT.master" AutoEventWireup="true" CodeFile="frmJ_TraineeWorkedCompInput.aspx.cs" 
    ValidateRequest="false" EnableEventValidation="false" Inherits="JOINT_frmJ_TraineeWorkedCompInput" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
会社履歴情報入力
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <link href="../Style/JsStyle.css" rel="stylesheet" type="text/css" />
    <link href="../Style/Style.css" rel="stylesheet" type="text/css" />
    <script src="../js/jquery.min.js" type="text/javascript" language="javascript"></script>
    <script src="../js/Validation.js" type="text/javascript"></script>
    <style>
        .detail-admin-row .detail-admin-label
        {
            width:260px;	
        }
    </style>
    <script type="text/javascript" language="javascript">

        $(document).ready(function() {
            registerEnterEvent("enter", "<%= btn_登録.ClientID %>", 8);
            registerControlToValidation("validation");
        });

        function CheckYear(oSrc, args) {
            var temp = args.Value;
            var 入社年月日年 = parseInt(document.getElementById('ctl00_ContentPlaceHolder1_ddl_入社年月日年').value);
            if (temp >= 入社年月日年) {
                args.IsValid = true;
            }
            else {
                args.IsValid = false;
            }
        }

        //CheckYearMonth
        function CheckYearMonth(oSrc, args) {
            var month2 = args.Value;
            var year2 = parseInt(document.getElementById('ctl00_ContentPlaceHolder1_ddl_退社年月日年').value);
            var year1 = parseInt(document.getElementById('ctl00_ContentPlaceHolder1_ddl_入社年月日年').value);
            var month1 = parseInt(document.getElementById('ctl00_ContentPlaceHolder1_ddl_入社年月日月').value);
            if (year1 > year2) {
                args.IsValid = false;
            }
            else if (year1 == year2) {
                if (month1 >= month2) {
                    args.IsValid = false;
                }
                else {
                    args.IsValid = true;
                }
            }
            else {
                args.IsValid = true;
            }
        }
    </script>
    
    <div  class="maindiv1">
    <br />
        <div class="Header3">
            <span>
                ※全ての職歴を入力してください。
                <br />
                ※一つ職歴が登録したら、登録ボタンを押して次の職歴を登録してください。
          </span>
        </div>
        <div>&nbsp;</div>
        <div class="detail-admin-row">
            <span class="detail-admin-label">会社名 :</span>
            <%--<asp:TextBox 
                ID="txt_会社名" 
                htmlencode="false"
                runat="server" 
                ValidationGroup="detailForm" 
                CssClass="Font_textbox japanese enter"
                MaxLength="100"
                Width="200px">
            </asp:TextBox>--%>
            <asp:DropDownList  
                ID="ddl_会社名" 
                ValidationGroup="detailForm" 
                CssClass="dropdownlist width2 enter validation"
                runat="server">
                <%--<asp:ListItem>-選択- 年</asp:ListItem>--%>
            </asp:DropDownList>
            
            <asp:RequiredFieldValidator 
                runat="server" 
                ID="RFV_会社名"
                ControlToValidate="ddl_会社名"
                Display="None"
                InitialValue="-1"
                SetFocusOnError ="false"
                ErrorMessage="" >
            </asp:RequiredFieldValidator> 
            
            <ajaxToolkit:ValidatorCalloutExtender 
                runat="Server" 
                ID="VCE_会社名"
                TargetControlID="RFV_会社名" 
                HighlightCssClass = "invalid"
                Width="240px"
                CssClass="CustomValidatorCalloutStyle" 
                WarningIconImageUrl="../Images/warning.png" >
            </ajaxToolkit:ValidatorCalloutExtender> 
            <span class="required-field"> *</span>
        </div>
        <div class="detail-admin-row">
            <span class="detail-admin-label"> 部門名 :</span>
            <asp:TextBox 
                ID="txt_部門名" 
                runat="server" 
                CssClass="textbox width2 japanese enter"
                ValidationGroup="detailForm" 
                MaxLength="100">
            </asp:TextBox>
        </div>
        <div class="detail-admin-row">
            <span class="detail-admin-label">  仕事内容 :</span>
            <asp:TextBox 
                ID="txt_仕事内容" 
                runat="server" 
                CssClass="textbox width2 japanese enter validation"
                ValidationGroup="detailForm" 
                MaxLength="1000">
            </asp:TextBox>
            
             <asp:RequiredFieldValidator 
                runat="server" 
                ID="RFV_仕事内容"
                ControlToValidate="txt_仕事内容"
                Display="None"
                SetFocusOnError ="false"
                ErrorMessage="" >
            </asp:RequiredFieldValidator> 
        
            <ajaxToolkit:ValidatorCalloutExtender 
                runat="Server" 
                ID="VCE_仕事内容"
                TargetControlID="RFV_仕事内容" 
                HighlightCssClass = "invalid"
                Width="240px"
                CssClass="CustomValidatorCalloutStyle" 
                WarningIconImageUrl="../Images/warning.png" >
            </ajaxToolkit:ValidatorCalloutExtender> 
            
            <span class="required-field"> *</span>
        </div>
        <div class="detail-admin-row">
            <span class="detail-admin-label">主な実績 :</span>
            <asp:TextBox 
                ID="txt_主な実績" 
                runat="server" 
                CssClass="textbox width2 japanese enter"
                ValidationGroup="detailForm" 
                MaxLength="500">
            </asp:TextBox>
        </div>
        <div class="detail-admin-row">
            <span class="detail-admin-label">入社年月日 :</span>
            
            <asp:DropDownList  
                ID="ddl_入社年月日年" 
                ValidationGroup="detailForm" 
                CssClass="dropdownlist width1 enter validation"
                runat="server">
            </asp:DropDownList>
            
             <asp:RequiredFieldValidator 
                runat="server" 
                ID="RFV_入社年月日年"
                ControlToValidate="ddl_入社年月日年"
                Display="None"
                InitialValue="-1"
                SetFocusOnError ="false"
                ErrorMessage="" >
            </asp:RequiredFieldValidator> 
            
            <ajaxToolkit:ValidatorCalloutExtender 
                runat="Server" 
                ID="VCE_入社年月日年"
                TargetControlID="RFV_入社年月日年" 
                HighlightCssClass = "invalid"
                Width="240px"
                CssClass="CustomValidatorCalloutStyle" 
                WarningIconImageUrl="../Images/warning.png" >
            </ajaxToolkit:ValidatorCalloutExtender> 
            <asp:DropDownList  
                ID="ddl_入社年月日月" 
                ValidationGroup="detailForm"
                CssClass="dropdownlist width1 enter validation"
                runat="server">
            </asp:DropDownList>
            
            <asp:RequiredFieldValidator 
                runat="server" 
                ID="RFV_入社年月日月"
                ControlToValidate="ddl_入社年月日月"
                Display="None"
                InitialValue="-1"
                SetFocusOnError ="false"
                ErrorMessage="" >
            </asp:RequiredFieldValidator> 
            
            <ajaxToolkit:ValidatorCalloutExtender 
                runat="Server" 
                ID="VCE_入社年月日月"
                TargetControlID="RFV_入社年月日月" 
                HighlightCssClass = "invalid"
                Width="240px"
                CssClass="CustomValidatorCalloutStyle" 
                WarningIconImageUrl="../Images/warning.png" >
            </ajaxToolkit:ValidatorCalloutExtender> 
            <span class="required-field"> *</span>
        </div>
        <div class="detail-admin-row">
            <span class="detail-admin-label">退社年月日 :</span>
            
            <asp:DropDownList  
                ID="ddl_退社年月日年" 
                ValidationGroup="detailForm" 
                CssClass="dropdownlist width1 enter validation"
                runat="server">
            </asp:DropDownList>
            
             <asp:RequiredFieldValidator 
                runat="server" 
                ID="RFV_退社年月日年"
                ControlToValidate="ddl_退社年月日年"
                Display="None"
                InitialValue="-1"
                SetFocusOnError ="false"
                ErrorMessage="" >
            </asp:RequiredFieldValidator> 
            
            <ajaxToolkit:ValidatorCalloutExtender 
                runat="Server" 
                ID="VCE_退社年月日年"
                TargetControlID="RFV_退社年月日年" 
                HighlightCssClass = "invalid"
                Width="240px"
                CssClass="CustomValidatorCalloutStyle" 
                WarningIconImageUrl="../Images/warning.png" >
            </ajaxToolkit:ValidatorCalloutExtender> 
            
            <asp:CustomValidator 
                ID= "CV_退社年月日年" 
                runat="server" 
                ErrorMessage="" 
                ControlToValidate="ddl_退社年月日年"  
                ClientValidationFunction="CheckYear" 
                Display ="None" 
                SetFocusOnError ="false"> 
            </asp:CustomValidator>
             
             <ajaxToolkit:ValidatorCalloutExtender 
                runat="Server" 
                ID="VCE_退社年月日年1"
                TargetControlID="CV_退社年月日年" 
                HighlightCssClass = "invalid"
                Width="225px"
                CssClass="CustomValidatorCalloutStyle" 
                WarningIconImageUrl="../Images/warning.png" >
            </ajaxToolkit:ValidatorCalloutExtender>
            
            <asp:DropDownList  
                ID="ddl_退社年月日月" 
                ValidationGroup="detailForm" 
                CssClass="dropdownlist width1 enter validation"
                runat="server">
            </asp:DropDownList>
            
            <asp:RequiredFieldValidator 
                runat="server" 
                ID="RFV_退社年月日月"
                ControlToValidate="ddl_退社年月日月"
                Display="None"
                InitialValue="-1"
                SetFocusOnError ="false"
                ErrorMessage="" >
            </asp:RequiredFieldValidator> 
            
            <ajaxToolkit:ValidatorCalloutExtender 
                runat="Server" 
                ID="VCE_退社年月日月"
                TargetControlID="RFV_退社年月日月" 
                HighlightCssClass = "invalid"
                Width="240px"
                CssClass="CustomValidatorCalloutStyle" 
                WarningIconImageUrl="../Images/warning.png" >
            </ajaxToolkit:ValidatorCalloutExtender> 
            
            <asp:CustomValidator 
                ID= "CV_退社年月日月" 
                runat="server" 
                ErrorMessage="" 
                ControlToValidate="ddl_退社年月日月"  
                ClientValidationFunction="CheckYearMonth" 
                Display ="None" 
                SetFocusOnError ="false"> 
            </asp:CustomValidator>
             
            <ajaxToolkit:ValidatorCalloutExtender 
                runat="Server" 
                ID="VCE_退社年月日月1"
                TargetControlID="CV_退社年月日月" 
                HighlightCssClass = "invalid"
                Width="225px"
                CssClass="CustomValidatorCalloutStyle" 
                WarningIconImageUrl="../Images/warning.png" >
            </ajaxToolkit:ValidatorCalloutExtender>
            
            <span class="required-field"> *</span>
        </div>
        <%-- <div class="detail-admin-row">
            <span class="detail-admin-label">企業分類コード :</span>
            <asp:DropDownList Width="150px" ID="ddl_企業分類コード" runat="server"></asp:DropDownList>
           
        </div>--%>
        <div class="detail-admin-row" style="margin-top:10px">
            <span class="detail-admin-label" style="width:230px">&nbsp;</span>
            <%--OnClientClick="alert('この部分がまだ作成しません。')" --%>
            <asp:Button 
                ID="btn_登録" 
                runat="server" 
                Text="登録"  
                CssClass="btn" 
                OnClientClick="javascript:focusToControlErr();"
                onclick="btn_登録_Click"  />
                
             &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
             <%--OnClientClick="alert('この部分がまだ作成しません。')" --%>
             <asp:Button 
                ID="btn_リセット" 
                runat="server" 
                Text="リセット" 
                CssClass="btn" 
                CausesValidation="false"
                onclick="btn_リセット_Click" />
         </div>
        <div class="headerLineAndGray">
            ＊会社履歴情報一覧
        </div>
        <div style="height: 30px">
        </div>
        <div class="detail-admin-row" style="margin:10px 10px 20px 50px">
            <asp:GridView 
                ID="grv" 
                runat="server" 
                AutoGenerateColumns="False" 
                 CssClass="mGrid" 
                 PagerStyle-CssClass="pgr" 
                 AlternatingRowStyle-CssClass="alt"
                 GridLines="Vertical"  
                 AllowPaging="true"
                 PageSize="10"
                 Width="690px"
                 onpageindexchanging="grv_PageIndexChanging" 
                 onrowcommand="grv_RowCommand" onrowdatabound="grv_RowDataBound">
                    <Columns>
                       
                        <asp:TemplateField HeaderText="会社名">
                            <ItemTemplate>
                                 <div style="width:200px;overflow:hidden;white-space:normal">
                                     <asp:Label
                                        runat="server"
                                        id="lbl_会社名"
                                        Text='<%#ShowTextLength(Eval("会社名").ToString())%>'
                                        Tooltip='<%#Eval("会社名")%>' />
                                 </div>
                            </ItemTemplate>
                        </asp:TemplateField>
                    
                        <asp:TemplateField HeaderText="部門名">
                            <ItemTemplate>
                                 <div style="width:200px;overflow:hidden;white-space:normal">
                                     <asp:Label
                                        runat="server"
                                        id="lbl_部門名"
                                        Text='<%#ShowTextLength(Eval("部門名").ToString())%>'
                                        Tooltip='<%#Eval("部門名")%>' />
                                 </div>
                            </ItemTemplate>
                        </asp:TemplateField>
                            
                        <asp:BoundField 
                            HeaderText="開始年月日" 
                            dataformatstring="{0:yyyy年MM月dd日}"
                            ItemStyle-HorizontalAlign="Center"
                            HeaderStyle-Width="140px"
                            DataField="開始年月日" />
                            
                        <asp:BoundField 
                            HeaderText="終了年月日" 
                            dataformatstring="{0:yyyy年MM月dd日}"
                            ItemStyle-HorizontalAlign="Center"
                            HeaderStyle-Width="140px"
                            DataField="終了年月日" />    
                                        
                        <asp:ButtonField Text="Button" CommandName="DoubleClick" Visible="false"/>
                    </Columns>
                
            </asp:GridView>
        </div>
        <div class="Header3">
              <span>
               ※修正があれば、修正する行をDouble clickして画面上に修正してください。
               <br />
               ※登録完了したら、翻訳ボタンを押してください。
              </span>
        </div>
        <div>&nbsp;</div>
    </div>

    <div class="detail-admin-row">
         <div class="btn_back">
            <asp:Button 
                ID="btnキャンセル" 
                CausesValidation="false" 
                runat="server" 
                Text="キャンセル" 
                CssClass="btn" 
                OnClick="btnキャンセル_Click"/>
         </div>
         <div class="btn_next btn_next_fixesforfrmJ_TraineeWorkedCompInput">
             <asp:Button 
                ID="btn翻訳" 
                CausesValidation="false" 
                runat="server" 
                Text="翻訳" 
                CssClass="btn" 
                OnClick="btn翻訳_Click"  />
         </div>
    </div>
  
    <div>&nbsp;</div>
    <br /> 
</asp:Content>

